The Count
property of the NetList<T>
class provides the number of elements contained in the list. This property is useful for determining the size of the list at any given time.
The Count
property of the NetList<T>
class provides the number of elements contained in the list. This property is useful for determining the size of the list at any given time.
To access the Count
property, simply use the property on an instance of NetList<T>
. This property is read-only and returns an integer representing the number of elements in the list.
// Example of using the Count property public class MyComponent : Component { [Sync] public NetList<int> MyIntegerList { get; set; } = new(); public void PrintCount() { int count = MyIntegerList.Count; // Use the count value as needed } }